<template>
  <div class="bg-white my-[10px]">
    <BaseHead style="border-bottom: 0">成员信息</BaseHead>
    <el-table :data="memberList" class="w-full" border stripe>
      <el-table-column type="index" label="序号" width="60px" />
      <el-table-column label="成员类型">
        <template #default="{ row }">
          <CommonLabel :value="row.memberType" :dataList="memberTypeList" />
        </template>
      </el-table-column>
      <el-table-column prop="personName" label="姓名" />
      <el-table-column label="工作单位">
        <template #default="{ row }">
          <CommonTreeLabel
            :value="row.unitId"
            :dataList="allUnitList"
            valueKey="codeColumn"
            labelKey="valueColumn"
            v-if="row.memberType != 3"
          />
          <span v-else>{{ row.unitName }}</span>
        </template>
      </el-table-column>
      <el-table-column label="职称">
        <template #default="{ row }">
          <CommonTreeLabel :value="row.titleId" :dataList="applierTitleList" />
        </template>
      </el-table-column>
      <el-table-column label="学位">
        <template #default="{ row }">
          <CommonLabel :value="row.eduDegreeId" :dataList="degreeList" />
        </template>
      </el-table-column>
      <el-table-column label="承担类型">
        <template #default="{ row }">
          <CommonLabel :value="row.bearTypeId" :dataList="cdTypeList" />
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script setup>
import BaseHead from "@/views/project/components/BaseHead.vue";
import { memberDetail } from "@/api/project/zx/lxxm";
import CommonLabel from "@/views/project/components/CommonLabel.vue";
import CommonTreeLabel from "@/views/project/components/CommonTreeLabel.vue";
const operateId = inject("id");
const memberTypeList = inject("memberTypeList");
const allUnitList = inject("allUnitList");
const applierTitleList = inject("applierTitleList");
const degreeList = inject("degreeList");
const cdTypeList = inject("cdTypeList");
const memberList = ref([]);
//获取成员信息详情
const getMemberDetail = async () => {
  const params = {
    proId: operateId.value,
  };
  try {
    const res = await memberDetail(params);
    memberList.value = res.data.bizZxProjectMemberList;
  } catch (error) {
    console.log(error);
  }
};
onMounted(() => {
  getMemberDetail();
});
</script>

<style scoped lang="scss"></style>
